import matplotlib.pyplot as plt
from next_level.Finance_Data.make_plot import makeplot
from next_level.Finance_Data.stock_load import load_stock


def do_plot_v2(stock_df,name_str):
    '''画移动平均线的函数
    绘制价格曲线和区间为 180 天的移动平均线
    '''
    makeplot(stock_df,'Close','closing price')
    makeplot(stock_df,'Close','360 day average',360)
    plt.title(name_str + 'Stock Price')
    plt.show()


if __name__ == '__main__':
    stock_df = load_stock('MSFT')
    do_plot_v2(stock_df, 'MSFT')

